<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css" rel="stylesheet">
    <link href="/public/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="/public/js/artDialog/skins/default.css" rel="stylesheet" />
    <link href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
	<script type="text/javascript">
	//全局变量
	var GV = {
	    ROOT: "/",
	    WEB_ROOT: "/",
	    JS_ROOT: "public/js/",
	    APP:'<?php echo (MODULE_NAME); ?>'/*当前应用名*/
	};
	</script>
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/wind.js"></script>
    <script src="/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
    <script>
    	$(function(){
    		$("[data-toggle='tooltip']").tooltip();
    	});
    </script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">首页广告图列表</a></li>
			<li><a href="<?php echo U('AdminHomeAds/add',array('id'=>empty($item['id'])?'':$item['id']));?>" target="_self">新增首页广告图</a></li>
		</ul>
        <form class="well form-search" method="post" action="<?php echo U('AdminHomeAds/index');?>">
            <select name="s_tid">
                <option value="">全部</option>
                <?php if(is_array($type_list)): foreach($type_list as $key=>$titem): ?><option <?php if($s_tid == $titem['id']): ?>selected<?php endif; ?> value="<?php echo ($titem["id"]); ?>">
                        <?php echo ($titem["title"]); ?>
                    </option><?php endforeach; endif; ?>
            </select> &nbsp;&nbsp;

            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="<?php echo U('AdminHomeAds/index');?>">清空</a>
        </form>
		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
                        <?php if(!empty($list)): ?><th width="50"><?php echo L('SORT');?></th><?php endif; ?>
                        <th width="50">分类名称</th>
                        <th width="50">图片</th>
						<th width="50">图片地址</th>
                        <th width="50">创建时间</th>
						<th width="70"><?php echo L('ACTIONS');?></th>
					</tr>
				</thead>
				<?php if(is_array($list)): foreach($list as $key=>$vo): ?><tr>
                    <?php if(!empty($list)): ?><td><input name="listorders[<?php echo ($vo["id"]); ?>]" class="input input-order" type="text" size="5" value="<?php echo ($vo["sort"]); ?>"></td><?php endif; ?>
                    <td><b><?php echo ($vo["title"]); ?></b></td>
                    <td><img src="<?php echo sp_get_image_preview_url($vo['picture']);?>" width="80"/></td>
                    <td><?php echo ($vo["url"]); ?></td>
					<td><?php echo ($vo["create_time"]); ?></td>
					<td>
						<a href="<?php echo U('AdminHomeAds/add',array('id'=>$vo['id']));?>"><?php echo L('EDIT');?></a> |
						<a href="<?php echo U('AdminHomeAds/delete',array('id'=>$vo['id']));?>" class="js-ajax-delete"><?php echo L('DELETE');?></a>
					</td>
				</tr><?php endforeach; endif; ?>
                <div class="table-actions">
                    <?php if(!empty($list)): ?><button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="<?php echo U('AdminHomeAds/listorders');?>"><?php echo L('SORT');?></button><?php endif; ?>
                </div>
			</table>

			<div class="pagination"><?php echo ($page); ?></div>
		</form>
	</div>
	<script src="/public/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "<?php echo U('AdminPost/index',$formget);?>";
			}
		}

	</script>
</body>
</html>